import { IsString, IsNotEmpty, MinLength, MaxLength } from "class-validator";
import { ApiProperty } from "@nestjs/swagger";

export class LoginDto {
  @ApiProperty({ description: "账号" })
  @MaxLength(50, { message: "account长度不超过50" })
  @IsString({ message: "不是有效的account" })
  @IsNotEmpty({ message: "account不能为空" })
  readonly account: string;

  @ApiProperty({ description: "初始密码" })
  @MinLength(6, { message: "password长度至少6" })
  @IsString({ message: "password不是有效的数据" })
  @IsNotEmpty({ message: "password不能为空" })
  readonly password: string;
}
